package com.jie.swaggerdemo.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jie.swaggerdemo.Model.Book;
import com.jie.swaggerdemo.service.BookService;
import com.jie.swaggerdemo.mapper.BookMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
* @author jie
* @description 针对表【t_book】的数据库操作Service实现
* @createDate 2022-04-04 21:13:33
*/
@Service("book")
public class BookServiceImpl extends ServiceImpl<BookMapper, Book>
    implements BookService{

    @Resource
    private BookMapper bookMapper;

    @Override
    public Book selectByPrimaryKey(String bookid) {
        return bookMapper.selectById(bookid);
    }

    @Override
    public List selectAll() {
        return bookMapper.selectAll();
    }

    @Override
    public int insert(Book book) {
        return baseMapper.insert(book);
    }

    @Override
    public int delete(Book book) {
        return bookMapper.deleteById(book);
    }

    @Override
    public int update(Book book) {
        return bookMapper.updateById(book);
    }
}




